// NewsPaperBoyClientComp.cpp : Implementation of DLL Exports.


#include "stdafx.h"

#include <cm/client_server/common.hpp>
#include <cm/client_server/version.hpp>
#include <cm/client_server/client.hpp>
#include <cm/Windows/TaskbarNotifier.h>
#include <cm/Windows/SoftNotifier.h>
#include <cm/Windows/NTray.h>
#include <cm/Windows/ButtonMenu.h>
#include <cm/Windows/ToolTipDialog.h>
#include <cm/Windows/wtl_avatar_control.h>
#include <cm/Windows/AboutCtrl.h>
#include <cm/Windows/AutoCombo.h>
#include <cm/Windows/ButtonST/ButtonST.h>

#include "resource.h"
#include "..\include\NewsPaperBoyClientCompApi.h"
#include "MainDlg.h"

unsigned long GetCurrentVersion()
{
	return cm::client_server::version_checker::uptodate_version_age;
}

void RunUserInterface(int nCmdShow,LPCSTR HostName,LPCSTR Port)
{
	if (std::string(HostName) != "")
	{
		host_name = HostName;
	}
	if (std::string(Port) != "")
	{
		port = Port;
	}

	CMessageLoop theLoop;
	_Module.AddMessageLoop(&theLoop);

	CMainDlg DlgMain;
	
	if (DlgMain.Create(NULL) == NULL)
	{
		ATLTRACE(_T("Main dialog creation failed!\n"));
		return;
	}

	DlgMain.ShowWindow(nCmdShow);

	int nRet = theLoop.Run();

	_Module.RemoveMessageLoop();
}
